import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:smart_security_box_app/route_config.dart';

import 'logic.dart';

class LoginPage extends StatelessWidget {
  final LoginLogic logic = Get.put(LoginLogic());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('验证主密码'),
      ),
      body: Container(
        padding: EdgeInsets.all(16),
        child: _buildForm(context),
      ),
    );
  }

  Widget _buildForm(BuildContext context){
    return Column(
      children: [
        TextField(
          decoration: InputDecoration(
            hintText: '请输入主密码',
          ),
        ),
        Padding(
          padding: EdgeInsets.only(top: 16),
          child: SizedBox(
            child: ElevatedButton(
              onPressed: () {
                Get.offNamed(RouteConfig.home);
              },
              child: Text('验证'),
            ),
            width: double.infinity,
          ),
        )
      ],
    );
  }
}
